#pragma once

#include <windows.h>

namespace TimeZone
{
	class Time : public SYSTEMTIME
	{
		void _time_tToFileTime(time_t t, FILETIME* pft);
		void _time_tToSystemTime(time_t t, SYSTEMTIME* pst);

	public:
		Time(void);
		Time(const SYSTEMTIME& time);
		explicit Time(int utc);
		~Time(void);

		operator SYSTEMTIME&		(void)			{ return *this; }
		operator const SYSTEMTIME&	(void) const	{ return *this; }

		bool						isValid(void) const;
		void						print(void) const;
		int							compare(const SYSTEMTIME& _right) const;
		bool						operator < (const SYSTEMTIME& _right) const;
		bool						operator <=(const SYSTEMTIME& _right) const;
		bool						operator ==(const SYSTEMTIME& _right) const;
		int							utc(int bias_sec) const; // if date is not valid, result is unspecified.
	};
}